git config --global user.name "user_name"
Set a name that is identifiable for credit when review version history.
git config --global user.email "valid email"
Set an email address that will be associated with each history marker.
git config --global color.ui auto
Set automatic command line colouring for git for easy reviewing.
mkdir folder name
mkdir means "make directory". the new directory is made below the current one.
cd foldername
also known as chdir(change directory),is a command - line shell command used to change the current working directory.
git init
Creates a new Git repository. We must maintain history of the project(delete, update, create etc) using git. This all history is stored in another folder that git provides us is known as git repository it named as .git .
ls
Lists the current directory contents and by default will not show hidden files.
git ls -a
To display hidden files.If any folder start with dot is hidden folder.
ls .git
List the content of .git folder. The .git folder contains all the information that is necessary for your project in version control and all the information about commit, remote repository address, etc. In general it tracks all the changes in our repository
touch filename.txt
Creates empty file.
git status
Display the state of the working directory and the staging area. It lets you see which changes have been staged, which haven't, and which files aren't being tracked by Git. Status output does not show you any information regarding the committed project history.
git add filename.txt
To add particular file to a staging area
git add .
To add all files to a staging area
git commit -m "Message"
Git commit messages are necessary to look back and see the changes made during a particular commit.Commits messages are the short description of the changes we make.
git log
The git log command display committed snapshots. It lets you list the project history, filter it, and search for specific changes. While